<%--
  Created by IntelliJ IDEA.
  User: HeiMei
  Date: 2015/11/9
  Time: 15:31
  To change this template use File | Settings | File Templates.
--%>

<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE HTML>
<html>

<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/public/mapObj.js"></script>
<head>
    <title></title>
</head>
<body>
<div class="pd-20">
  <form action="" method="post" class="form form-horizontal" id="form-fieldPark-edit">
    <input type="hidden" name="uuid" value="${fieldParkInfo.uuid}">
    <div class="row cl">
      <label class="form-label col-2"><span class="c-red">*</span>道路停车场编号：</label>
      <div class="formControls col-10">
        <input type="text" class="input-text"   id="ParkNo">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-2">停车场名称：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text" placeholder=""   id="ParkName">
      </div>
      <label class="form-label col-2">所属区域：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text"placeholder=""  id="District">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-2"><span class="c-red">*</span>停车场地址：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text" placeholder=""  id="ParkAddr">
      </div>
      <label class="form-label col-2"><span class="c-red">*</span>停车位总数：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text" placeholder=""  id="TotalNum">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-2">地图经度：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text"  placeholder=""  id="Lng">
      </div>
      <label class="form-label col-2">地图维度：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text"  placeholder=""  id="Lat">
      </div>
      <label class="form-label col-2">地图：</label>
      <div class="formControls col-2">
        <div class="divFloat">
        <a onClick="findLocalPoint()" class="btn btn-default radius">选择坐标</a>
        </div>
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-2">开放时间：</label>
      <div class="formControls col-10">
        <input type="text" class="input-text" placeholder=""  id="OpenTime">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-2">标志数量：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text"  placeholder=""  id="SignNum">
      </div>
      <label class="form-label col-2">开放时间：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text" placeholder="" id="OpenNTime">
      </div>
      <label class="form-label col-2">标志：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text"  placeholder="" id="Remark">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-2">停车类型：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text" placeholder=""  id="ParkType">
      </div>
      <label class="form-label col-2">费用：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text"  placeholder=""  id="Fee">
      </div>
      <label class="form-label col-2"><span class="c-red">*</span>电子犬数量：</label>
      <div class="formControls col-2">
        <input type="text" class="input-text"  placeholder=""  id="CurNum">
      </div>
    </div>
    <div class="row cl">
      <label class="form-label col-2">联系电话：</label>
      <div class="formControls col-10">
        <input type="text" class="input-text"  placeholder=""  id="LXPhone">
      </div>
    </div>
    <div class="row cl">
      <div class="col-10 col-offset-2">
        <button onClick="filepark_save();" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
        <button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
      </div>
    </div>
  </form>
</div>
</body>
</html>
<%@include file="../../head-ui.jsp" %>
<script type="text/javascript">
  function filepark_save(){
    $.ajax({
      url: '<%=request.getContextPath()%>/back/roadpark/updateRoadPark.do',
      type: 'POST',
      data:  "parkno="+ $('#ParkNo').val()+"&parkname="+$('#ParkName').val()+"&parkaddr="+ $('#ParkAddr').val()+"&totalnum="+$('#TotalNum').val()
      +"&opentime="+ $('#OpenTime').val()+"&signnum="+$('#SignNum').val()+"&openntime="+ $('#OpenNTime').val()+"&remark="+$('#Remark').val()
      +"&parktype="+ $('#ParkType').val()+"&lng="+$('#Lng').val()+"&lat="+ $('#Lat').val()+"&fee="+$('#Fee').val()
      +"&curnum="+ $('#CurNum').val()+"&district="+$('#District').val()+"&lxphone="+$('#LXPhone').val()+"&id="+${roadpark.id},
      success: function () {
        layer.alert('保存成功!', {
          icon: 1,//2表示保存失败图标，1表示保存成功
          closeBtn: false,
          shadeClose: true,
          title: "提示"
        }, function (index) {
          layer.close(index)
        });
      }
    })
  }

  $(function(){
    $('#ParkNo').val('${roadpark.parkno}');
    $('#ParkName').val('${roadpark.parkname}');
    $('#ParkAddr').val('${roadpark.parkaddr}');
    $('#TotalNum').val('${roadpark.totalnum}');
    $('#OpenTime').val('${roadpark.opentime}');
    $('#SignNum').val('${roadpark.signnum}');
    $('#OpenNTime').val('${roadpark.openntime}');
    $('#Remark').val('${roadpark.remark}');
    $('#ParkType').val('${roadpark.parktype}');
    $('#Fee').val('${roadpark.fee}');
    $('#CurNum').val('${roadpark.curnum}');
    $('#LXPhone').val('${roadpark.lxphone}');
    $('#District').val('${roadpark.district}');
    $('#Lng').val('${roadpark.lng}');
    $('#Lat').val('${roadpark.lat}');
  });
  function findLocalPoint(){
    var lng=$("#Lng").val();
    var lat=$("#Lat").val();
    var myurl= "<%=request.getContextPath()%>/back/roadpark/roadPark-Map.do?lng="+lng+"&lat="+lat;
    layer.open({
      type: 2,
      title:"坐标选择(拖动红点选择位置)",
      area: ['500px', '510px']
      ,shade: 0,
      content:myurl,
    })
  }
  var mapObj = null;

</script>

